<%@page import="com.ilibrary.constants.MyConstants"%>
<%@page import="com.ilibrary.web.vo.AdminVO"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@include file="_common.jsp" %>
<title>登录页</title>
</head>

<%
	String loginError = (String)request.getAttribute("loginError");
%>

<body>
	<div style="width: 100%;height: auto;overflow: hidden;">
		<div style="width: 100%;height: 150px;"></div>
		<div style="width: 100%;height: 250px;">
			<div style="float: left;width: 35%;height: 100%;"></div>
			<div style="padding: 50px;float: left;width: auto;height: auto;border: 1px solid green;">
				<div style="color: red">
				<%
					if(loginError != null) {
						out.println(loginError);
					}
				%>
				</div>
				<form action="<%=request.getContextPath() %>/doLogin.action" id="loginForm" method="post">
					用户ID：<input type="text" id="userId" name="userId"><br>
					密&nbsp;&nbsp;码：<input type="password" id="userPassword" name="userPassword"><br>
					身&nbsp;&nbsp;份：<input type="radio" name="userType" checked="checked" value="<%=MyConstants.ILIBRARY_LOGIN_TYPE_STU%>">学生
									<input type="radio" name="userType" value="<%=MyConstants.ILIBRARY_LOGIN_TYPE_ADMIN%>">管理员<br>
					<input style="margin-left: 100px;" type="button" onclick="reset();" value="重置">
					<input type="button" value="登录" onclick="doLogin()">
				</form>
			</div>
		</div>
	</div>
</body>

<script type="text/javascript">
	function doLogin() {
		var userId = $('#userId').val();
		var userPassword = $('#userPassword').val();
		var userType = $('input[name="userType"]').val();
		if(!userId) {
			alert("请填入登录用户名！");
			return false;
		}
		if(!userPassword){
			alert("请输入登录密码！");
			return false;
		}
		if(!userType) {
			alert("请选择用户类型！");
			return false;
		}
		$('#loginForm').submit();
	}
	function reset() {
		$('#loginForm').reset();
	}
</script>

</html>